//封装购物车相关接口
import { request } from "@/utils/request";
export const getCartAPI = () => {
  return request({
    url: "/member/cart",
    method: "get",
  });
};
export const insertCartAPI = ({
  skuId,
  count,
}: {
  skuId: string;
  count: number;
}) => {
  return request({
    url: "/member/cart",
    method: "post",
    data: {
      skuId,
      count,
    },
  });
};

export const deleteCartAPI = (ids: string[]) => {
  return request({
    url: "/member/cart",
    method: "delete",
    data: {
      ids,
    },
  });
};
//合并购物车
export const mergeCartAPI = (data: any) => {
  return request({
    url: "/member/cart/merge",
    method: "post",
    data,
  });
};
